﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ItemsDiscount
	{
	class Program
		{
		static void Main(string[] args)
			{
			int[] disPerc = new int[4] { 0, 5, 10, 15 };
			int[] disItem = new int[4] { 0, 10, 25, 61 };
			int totalItems = 0, totalDiscount = 0;
			getItems(ref totalItems);
			getDiscount(disItem, disPerc, totalItems, ref totalDiscount);
			print("The customer get a " + totalDiscount + "% discount.");
			}

		static void getDiscount(int[] disItem, int[] disPerc, int totalItems, ref int totalDiscount)
			{
			int i = 3;
			while (totalItems < disItem[i])
				i--;
			totalDiscount = disPerc[i];
			}

		static void getItems(ref int totalItems)
			{
			print("How many items is the customer purchasing?");
			while (!int.TryParse(Console.ReadLine(), out totalItems) || totalItems < 0)
				{
				print("The total number provided is not a valid Whole number");
				}
			}

		static void print(string p)
			{
			Console.WriteLine("\n" + p);
			}
		}
	}
